package thread;

public class Demo_204 {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            while (true) {
                System.out.println("hello thread...");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "大圣");
        // 启动线程
        thread.start();

        System.out.println("线程Id = " + thread.getId());
        System.out.println("线程名 = " + thread.getName());
        System.out.println("线程状态 = " + thread.getState());
        System.out.println("线程优先级 = " + thread.getPriority());
        System.out.println("线程是否后台 = " + thread.isDaemon());
        System.out.println("线程是否存活 = " + thread.isAlive());
        System.out.println("线程是否中断 = " + thread.isInterrupted());
    }
}